package com.success.task.web.lucene.data;

import java.util.List;

import com.success.task.web.utils.PublicSettings;

public class DefaultSearchResult implements SearchResult {
	
	private List<ResultData> results = null;
	private long searchTime = 0L;
	private long totalResults = 0L;
	
	public DefaultSearchResult(List<ResultData> datas,long searchTime,long totalResults) {
		results = datas;
		this.searchTime = searchTime;
		this.totalResults = totalResults;
	}
	@Override
	public List<ResultData> getResultDatas() {
		return results;
	}
	@Override
	public long getSearchTime() {
		return searchTime;
	}
	public void setSearchTime(long searchTime) {
		this.searchTime = searchTime;
	}
	@Override
	public long getTotalResults() {
		return totalResults;
	}
	
	@Override
	public long getTotalPages() {
		return (totalResults-1)/PublicSettings.searchPageSize+1;
	}
	public void setTotalResults(long totalResults) {
		this.totalResults = totalResults;
	}
}
